import { getMenuApi } from "../apis/users"
// async function hqMenus(){
//     const res = await getMenuApi();
//     console.log(res);
//     const sideMenus = handleMenus(res[0].children);
//     // console.log(sideMenus);
//     return sideMenus
// }
// const a = await hqMenus();
// console.log("a",a);
// export const sideMenus=a;
export const sideMenus = [
    {label:"首页",key:"/nav/home"},
]
function handleMenus(menus) {
    return menus.map(item => {
      const o = {
        title: item.name,
        label: item.name,
        key: "/nav"+item.path
      }
      if (item.children) {
        o.children = handleMenus(item.children);
      }
      if (item.icon) {
        // o.icon = "<i className={'iconfont iconfont-' + item.icon} />";
      }
      return o;
    })
  }